package com.open.party.cloud.view.home.juBao

import android.os.Bundle
import android.view.View
import cn.android.x.parent.AppTitleBaseActivity
import com.open.party.cloud.R
import com.open.party.cloud.viewModel.BizViewModel
import com.sinothk.android.utils.XUtils
import kotlinx.android.synthetic.main.activity_12380_ju_bao_class.*


class JuBao12380JuBaoClassActivity : AppTitleBaseActivity(), View.OnClickListener {

    companion object {
        var JB_CLass_Ge_Ren = 1 // 个人
        var JB_CLass_Dan_Wei = 2 // 单位

        var JB_Style_Ni_Ming = 1 // 匿名
        var JB_Style_Shi_Ming = 2 // 实名
    }

    var class1 = 0
    var viewModel: BizViewModel? = null
    var area = ""

    override fun getLayoutResId(): Int = R.layout.activity_12380_ju_bao_class

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        area = intent.getStringExtra("area") as String
        class1 = intent.getIntExtra("class1", 0)
        if (class1 == 0) {
            setViewTitle("举报个人")
        } else {
            setViewTitle("举报单位")
        }

        submitBtn01.setOnClickListener(this)
        submitBtn02.setOnClickListener(this)
    }

    override fun onClick(v: View?) {

        when (v) {
            submitBtn01 -> {
                XUtils.intent().openActivity(this, JuBao12380JuBaoShiMingActivity::class.java)
                    .putIntExtra("class1", class1)
                    .putIntExtra("class2", JB_Style_Shi_Ming)
                    .putStringExtra("area", area)
                    .finish(true)
                    .start()
            }
            submitBtn02 -> {
                XUtils.intent().openActivity(this, JuBao12380JuBaoNiMingActivity::class.java)
                    .putIntExtra("class1", class1)
                    .putIntExtra("class2", JB_Style_Ni_Ming)
                    .putStringExtra("area", area)
                    .finish(true)
                    .start()
            }
        }
    }
}